package com.cssl.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 用户信息表
 */
@Data
@Schema(description = "用户信息")
public class User implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "用户ID")
    private long number;
    @Schema(description = "用户密码",example = "admin123",requiredMode = Schema.RequiredMode.REQUIRED)
    private String cipher;
    @Schema(description = "用户名",example = "凉先生",required = true)
    private String name;
    @Schema(description = "年龄",example = "18",required = true)
    private int age;
    @Schema(description = "身份证号码",example = "431124200312201458",required = true)
    private String id_number;
    @Schema(description = "手机号码",example = "15672297155",required = true)
    private String phone;
    @Schema(description = "余额",example = "100.00$",required = true)
    private BigDecimal balance;
    @Schema(description = "身份",example = "0:顾客 1:网管 2:管理员",required = true)
    private int job;
    @Schema(description = "是否启用",example = "0:禁用 1:启用",required = true)
    private int activate;

    private Integer version; //乐观锁版本号

    public User() {
    }

    public User(String cipher, String name,String phone,int age, String id_number, BigDecimal balance) {
        this.cipher = cipher;
        this.name = name;
        this.phone = phone;
        this.age = age;
        this.id_number = id_number;
        this.balance = balance;
    }
}
